// 知识点：unique_copy()：拷贝不重复元素，back_insert()：插入迭代器(需包含iterator头文件)
#include <algorithm>
#include <functional>
#include <iostream>
#include <iterator>
#include <numeric>
#include <string>
#include <vector>

using namespace std;
using namespace placeholders; //占位符的命名空间

int main(int argc, char **argv) {
  string a[10] = {"love", "love8", "love",        "love", "love",
                  "h",    "diuw",  "diuwudhg257", "love", "d"};
  vector<string> vec1(a, a + 10); //利用数组初始化vector
  vector<string> vec2;
  //实现包含头文件iterator
  unique_copy(vec1.cbegin(), vec1.cend(),
              back_inserter(vec2)); //不支持push_front?

  cout << "字符串中的不重复字符为：";
  for (int i = 0; i < vec2.size(); ++i) {
    cout << vec2[i] << " ";
  }
  return 0;
}